const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const companySchema = new mongoose.Schema({
  //公司名称
  company_name: {
    type: String,
    required: [true, "you must tell us your company name"],
  },
  //公司地址
  address: {
    type: String,
    required: [true, "you must tell us your company address"],
  },
  //公司详细地址
  detailed_address: {
    type: String,
    required: [true, "you must tell us your company detailed address"],
  },
  //公司电话
  company_phone: {
    type: String,
    required: [true, "you must tell us your company phone"],
  },
  //负责人名称
  admin_name: {
    type: String,
    required: [true, "The name of the head of the company is required"],
  },
  //负责人电话
  admin_phone: {
    type: String,
    required: [true, "The phone of the head of the company is required"],
  },
  //负责人微信
  admin_weChat: {
    type: String,
  },
  //是否三证合一
  ifone: {
    type: Boolean,
    required: [true, "Whether three certificates in one"],
    default: true,
  },
  //营业执照
  charter: {
    type: String,
    required: [true, "A business license is required"],
  },
  //组织机构代码
  organization_code: {
    type: String,
  },
  //税务登记证
  tax_certificate: {
    type: String,
  },
  //开户许可证
  open_account: {
    type: String,
    required: [true, "An account opening permit is required"],
  },
  //授权书
  authorization: {
    type: String,
    required: [true, "A power of attorney is required"],
  },
});
const Company = mongoose.model("Company", companySchema);
module.exports = Company;
